<?php
// +----------------------------------------------------------------------
// | 认证设置
// +----------------------------------------------------------------------

return [
    /**
     * 默认守卫
     */

    'default_guard' => 'api',

    /**
     * 同一时间，是否只允许一个终端登录
     */

    'single_endpoint' => true,

    'guards' => [
        // 用于前台用户的认证
        'api' => [
            'driver' => 'token',
            'provider' => 'user',
        ],

        // 用于后台管理员的认证
        'api_for_admin' => [
            'driver' => 'token',
            'provider' => 'admin',
        ],
    ],

    'providers' => [
        'user' => [
            'driver' => 'orm',
            'model' => app\model\User::class,
        ],

        'admin' => [
            'driver' => 'orm',
            'model' => app\model\Admin::class,
        ],
    ],

    /**
     * 认证标识过期时间，单位：分钟，设置为 null 表示永不过期
     */

    'expiration' => null,
];
